import { fetchToken, fetchNoMsg, fetchDownload } from '@/utils/fetch'
/* ============订单管理-列表============*/
export function orderList(data) {
  return fetchNoMsg({
    url: '/order/goods/list',
    method: 'get',
    params: data
  })
}
/* ============订单管理-列表============*/
export function orderStatus(data) {
  return fetchNoMsg({
    url: '/order/goods/status',
    method: 'get',
    params: data
  })
}
/* ============---获取-初审客户/终审客户============*/
export function customerModify(data) {
  return fetchNoMsg({
    url: '/order/goods/get_customer_audit_info',
    method: 'get',
    params: data
  })
}
/* ============---保存-初审客户/终审客户============*/
export function customerSave(data) {
  return fetchToken({
    url: '/order/goods/save_customer_audit_info',
    method: 'post',
    data
  })
}

/* ============---获取-递交合同============*/
export function contractModify(data) {
  return fetchNoMsg({
    url: '/order/goods/get_submit_contract_info',
    method: 'get',
    params: data
  })
}
/* ============---保存-递交合同============*/
export function contractSave(data) {
  return fetchToken({
    url: '/order/goods/save_submit_contract_info',
    method: 'post',
    data
  })
}
/* ============---获取-归还资料============*/
export function backModify(data) {
  return fetchNoMsg({
    url: '/order/goods/get_goods_order_back_info',
    method: 'get',
    params: data
  })
}
/* ============---保存-归还资料============*/
export function backSave(data) {
  return fetchToken({
    url: '/order/goods/save_goods_order_back_type',
    method: 'post',
    data
  })
}
/* ============---获取-审核上牌============*/
export function billModify(data) {
  return fetchNoMsg({
    url: '/order/goods/get_goods_order_check_bill_list',
    method: 'get',
    params: data
  })
}
/* ============---保存-审核上牌============*/
export function billSave(data) {
  return fetchToken({
    url: '/order/goods/save_goods_order_audit_bill',
    method: 'post',
    data
  })
}
/* ============---获取-申请开票(公司)============*/
export function companyModify(data) {
  return fetchNoMsg({
    url: '/order/goods/get_invoic_company_info_by_order_id',
    method: 'get',
    params: data
  })
}
/* ============---保存-申请开票(公司)============*/
export function companySave(data) {
  return fetchToken({
    url: '/order/goods/save_invoic_info_apply_for_company',
    method: 'post',
    data
  })
}
/* ============---获取-申请开票(个人)============*/
export function personalModify(data) {
  return fetchNoMsg({
    url: '/order/goods/get_invoic_personal_info_by_order_id',
    method: 'get',
    params: data
  })
}
/* ============---保存-申请开票(个人)============*/
export function personalSave(data) {
  return fetchToken({
    url: '/order/goods/save_invoic_info_apply_for_personal',
    method: 'post',
    data
  })
}

/* ============---获取-递交发票============*/
export function invoiceModify(data) {
  return fetchNoMsg({
    url: '/order/goods/get_goods_order_submit_invoice_info',
    method: 'get',
    params: data
  })
}
/* ============---保存-递交发票--============*/
export function invoiceSave(data) {
  return fetchToken({
    url: '/order/goods/save_goods_order_submit_invoice_type',
    method: 'post',
    data
  })
}

/*
  ============---获取-审核定金/全款信息============
*/
export function auditModify(data) {
  return fetchNoMsg({
    url: '/order/goods/get_deposit_full_audit_info',
    params: data
  })
}
/* ============---保存-审核定金/全款信息============*/
export function auditSave(data) {
  return fetchToken({
    url: '/order/goods/save_deposit_full_audit_info',
    method: 'post',
    data
  })
}

/* ============---获取-尾款审核信息============*/
export function balanceModify(data) {
  return fetchNoMsg({
    url: '/order/goods/get_balance_payment_order_by_id',
    method: 'get',
    params: data
  })
}
/* ============---保存-尾款审核============*/
export function balanceSave(data) {
  return fetchToken({
    url: '/order/goods/save_order_audit_tail',
    method: 'post',
    data
  })
}
/* ============---获取-归还保证金============*/
export function marginModify(data) {
  return fetchNoMsg({
    url: '/order/goods/get_goods_order_back_margin_info',
    method: 'get',
    params: data
  })
}
/* ============---保存-归还保证金============*/
export function marginSave(data) {
  return fetchToken({
    url: '/order/goods/save_goods_order_back_margin',
    method: 'post',
    data
  })
}

/*
  ============---获取-确认取车============
*/
export function confirmModify(data) {
  return fetchNoMsg({
    url: '/order/goods/get_confirm_extraction_vehicle_info',
    method: 'get',
    params: data
  })
}
/* ============---保存-确认取车============*/
export function confirmSave(data) {
  return fetchToken({
    url: '/order/goods/save_confirm_extraction_vehicle_info',
    method: 'post',
    data
  })
}
/* ============---获取-更换车辆============*/
export function replacementModify(data) {
  return fetchNoMsg({
    url: '/order/goods/get_replacement_vehicle_info',
    method: 'get',
    params: data
  })
}

/* ============---获取VIN列表============*/
export function vinList(data) {
  return fetchNoMsg({
    url: '/order/goods/get_vehicle_vin_list',
    method: 'get',
    params: data
  })
}
/* ============---获取VIN列表============*/
export function vinSave(data) {
  return fetchToken({
    url: '/order/goods/save_vehicle_vin',
    method: 'post',
    data
  })
}

/*
  ============---获取审核开票（公司）============
*/
export function getCompanyModify(data) {
  return fetchNoMsg({
    url: '/order/goods/get_audit_invoice_company_info_by_order_id',
    method: 'get',
    params: data
  })
}
/*
============---获取审核开票（个人）============
*/
export function getPersonalModify(data) {
  return fetchNoMsg({
    url: '/order/goods/get_audit_invoice_personal_info_by_order_id',
    method: 'get',
    params: data
  })
}
/* ============---保存-审核开票（公司/个人）============*/
export function auditOpeninvoiceSave(data) {
  return fetchToken({
    url: '/order/goods/save_goods_order_audit_openinvoice',
    method: 'post',
    data
  })
}
/* ============查看订单============*/
export function lookOrder(orderId) {
  return fetchNoMsg({
    url: '/order/goods/get_admin_order_info',
    method: 'get',
    params: { orderId }
  })
}

/* ============取消订单============*/
export function cancelGoodsOrder(orderId) {
  return fetchToken({
    url: '/order/goods/cancel_goods_order',
    method: 'post',
    params: { orderId: orderId }
  })
}
/* *
   ============---查看归档资料信息============
* */
export function lookArchival(data) {
  return fetchNoMsg({
    url: '/order/goods/get_archival_info',
    method: 'get',
    params: data
  })
}
/* *
   ============---保存归档资料信息============
* */
export function saveArchival(data) {
  return fetchToken({
    url: '/order/goods/save_archival_info',
    method: 'post',
    data
  })
}
// 导出订单
export const infoExport = '/amdms/api/order/goods/export_admin_order_info'
/*export function infoExport(data) {
  return fetchDownload({
    url: '/order/goods/export_admin_order_info',
    method: 'get',
    params: {orderId: data}
  })
}
*/
export function myUpload(data) {
  return fetchNoMsg({
    url: '/file/upload/',
    method: 'post',
    data
  })
}

